Skip to content

fix(cli): accept reordered agent report arguments - #2928

Merged
ogulcancelik merged 1 commit into
masterfrom
akbash/2926-report-agent-args
Aug 25, 2026
Merged

fix(cli): accept reordered agent report arguments#2928
ogulcancelik merged 1 commit into
masterfrom
akbash/2926-report-agent-args

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Issue

An integration that follows pane report-agent or pane report-agent-session help and places the pane ID after the options gets rejected, so the report never reaches the pane. The equivalent pane-first command works.

Problem

CLI help and completions describe normal order-independent options, but these two commands separately assumed the first argument was always the pane ID. An options-first call therefore treated --source as the pane and rejected its value as an unknown option; the same parsers also did not understand --option=value.

How did we fix it?

Both agent-report commands now extend the existing flexible pane-argument mechanism: they accept one pane ID anywhere among their options and normalize valued --option=value arguments before sending the existing request. This is limited to command-line parsing; pane state ownership, report authority, server behavior, and the existing empty success output are unchanged.

Verification

Before the change, both help-ordered commands exited 2 with unknown option: test:akbash and left the disposable session's agent list empty. After the change, the same commands exited 0, and the state report changed the target pane to working; an equals-form report with an embedded = value also exited 0 and changed it to blocked.

just test-one pane_agent_reports_accept_options_before_pane passes. Formatting, native and Windows Clippy, 98 maintenance tests, integration assets, marketplace tests, and 3,470 other Rust tests pass. The unrelated pre-existing live_server_holds_one_pty_master_fd_per_pane test could not find its replacement process in this VPS environment and failed again in isolation.

refs #2926

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pane reporting commands now accept pane IDs after options, support --option=value syntax, reject extra positional arguments, and show usage when the pane ID is missing. End-to-end coverage verifies agent and session reporting.

Changes

Pane report argument parsing

Layer / File(s) Summary
Update pane report parsers
src/cli/pane.rs
pane report-agent and pane report-agent-session accept reordered pane IDs, expand equals-style options, reject extra positional arguments, and show usage when the pane ID is missing.
Validate and document parsing
tests/cli/panes.rs, docs/next/CHANGELOG.md
The end-to-end test covers options before pane IDs and verifies stored agent state. The changelog documents the accepted argument forms.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to 03c8b

The commands now accept pane IDs before or after options and support equals-form options, but the changelog still describes only one ordering, which may mislead users and integrations. The PR is mergeable with an update to the changelog.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: accepting reordered agent report arguments in the CLI.
Description check ✅ Passed The description directly explains the CLI parsing issue, the implemented fix, and the verification results for the reported commands.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akbash/2926-report-agent-args

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ec399cc-948c-4018-a316-1219932c29d3

📥 Commits

Reviewing files that changed from the base of the PR and between 2d24950 and 9d30965.

📒 Files selected for processing (3)
  • docs/next/CHANGELOG.md
  • src/cli/pane.rs
  • tests/cli/panes.rs

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.

Comment thread src/cli/pane.rs
@ogulcancelik

Copy link
Copy Markdown
Collaborator

@akbash-bot the implementation review is clean. please rebase onto current master, resolve the changelog conflict, and rerun checks and both review bots.

@ogulcancelik
ogulcancelik force-pushed the akbash/2926-report-agent-args branch from 9d30965 to 03c8baa Compare August 25, 2026 19:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c0fa6371-7911-45e4-9ba4-dd8dbefec48f

📥 Commits

Reviewing files that changed from the base of the PR and between 9d30965 and 03c8baa.

📒 Files selected for processing (1)
  • docs/next/CHANGELOG.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread docs/next/CHANGELOG.md Outdated
- Tab bar status commands now remove ESC-prefixed terminal control sequences instead of displaying their sequence bodies as text. (#3001)
- Unix plugin pane commands now default `PWD` to their resolved working directory, so direct popup tools open at explicit `--cwd` paths while preserving caller-provided `PWD` values. (#2984)
- Plugin link handlers now receive matching OSC 8 `file://` clicks while unmatched file links remain excluded from the system URL opener. (#2941)
- `pane report-agent` and `pane report-agent-session` now accept the pane ID after their options, as shown by CLI help, and support `--option=value` syntax. (#2926)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document both accepted pane-ID positions.

Line 27 says that the pane ID must follow the options. The parser accepts options before or after the pane ID. Update the entry to match the CLI contract and avoid misleading users.

Suggested wording
-- `pane report-agent` and `pane report-agent-session` now accept the pane ID after their options, as shown by CLI help, and support `--option=value` syntax. (`#2926`)
+- `pane report-agent` and `pane report-agent-session` now accept options before or after the pane ID, as shown by CLI help, and support `--option=value` syntax. (`#2926`)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `pane report-agent` and `pane report-agent-session` now accept the pane ID after their options, as shown by CLI help, and support `--option=value` syntax. (#2926)
- `pane report-agent` and `pane report-agent-session` now accept options before or after the pane ID, as shown by CLI help, and support `--option=value` syntax. (#2926)

@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

The PR makes both agent-report commands accept the pane ID before or after their options and supports recognized --option=value forms without changing request handling.

  • Adds order-independent pane-ID extraction to report-agent and report-agent-session.
  • Normalizes recognized equals-form arguments while preserving embedded equals signs in values.
  • Adds integration coverage for reordered arguments and equals-form values.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/cli/pane.rs Updates both agent-report parsers to extract one positional pane ID flexibly and expand recognized equals-form options.
tests/cli/panes.rs Adds end-to-end coverage for options-first reports, embedded equals signs, request success, and resulting agent state.

Reviews (2): Last reviewed commit: "fix(cli): accept reordered agent report ..." | Re-trigger Greptile

@ogulcancelik
ogulcancelik force-pushed the akbash/2926-report-agent-args branch from 03c8baa to ffad3ff Compare August 25, 2026 19:29
@ogulcancelik
ogulcancelik merged commit da5357d into master Aug 25, 2026
7 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 25, 2026
joonhwan pushed a commit to joonhwan/herdr that referenced this pull request Aug 25, 2026
refs herdrdev#2926

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants